#pragma once
#include "Bindable.h"
class Surface;
class Texture : public Bindable
{
public:
	Texture(Graphics& gfx, const std::string& path, UINT slot = 0);
	void Bind(Graphics& gfx) override;
	static std::shared_ptr<Texture> Create(Graphics& gfx, const std::string& path, UINT slot = 0);

	bool HasAlpha() const noexcept;
	ID3D11ShaderResourceView* GetSRV() { return pTextureView.Get(); }
private:
	static UINT CalculateNumberOfMipLevels(UINT width, UINT height) noexcept;
private:
	unsigned int slot;
protected:
	bool hasAlpha = false;
	std::string path;
	Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> pTextureView;
};
